<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>详细合同</title>
		<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="../js/layui/css/layui.css"/>
	</head>
	<body>
		<div class="layui-form">
		  <table class="layui-table">
		    <colgroup>
		      <col width="150">
		      <col width="150">
		      <col width="150">
		      <col width="150">
		    </colgroup>
		    <thead>
		      <tr>
		        <th colspan="4" style="text-align: center;">甲方(医生)</th>
		      </tr> 
		    </thead>
		    <tbody>
		      <tr>
		        <td>签约机构</td>
		        <td id="JG"></td>
						<td>机构地址</td>
						<td id="JG_address"></td>
		      </tr>
					<tr>
						<td>签约团队</td>
						<td id="sign_team"></td>
						<td>签约医生</td>
						<td id="Doc_name"></td>
					</tr>
					<tr>
						<td>身份证</td>
						<td id="Doc_id"></td>
						<td>合同编号</td>
						<td id="contract_number"></td>
					</tr>
					<thead>
						<tr>
							<th colspan="4" style="text-align: center;">乙方(签约用户)</th>
						</tr>
					</thead>
		      <tr>
		        <td>姓名</td>
		        <td id="patName"></td>
		        <td>签约服务包</td>
		        <td id="pakName"></td>
		      </tr>
		      <tr>
		        <td>身份证</td>
		        <td id="patIdNum"></td>
		        <td>服务人群</td>
		        <td id="serPeople"></td>
		      </tr>
		      <tr>
		        <td>签约地址</td>
		        <td id="patAddr"></td>
		        <td>收费标准</td>
		        <td></td>
		      </tr>
		      <tr>
		        <td>联系方式</td>
		        <td id="phone"></td>
		        <td>签约时长</td>
		        <td id="duration"></td>
		      </tr>
					<tr>
						<td>签约时间</td>
						<td id="startTime"></td>
						<td>签约机构</td>
						<td id="hospital"></td>
					</tr>
					<tr>
						<td>备注</td>
						<td colspan="3" id="tips"></td>
					</tr>
		    </tbody>
		  </table>
		</div>
		<script type="text/javascript">
			window.onload = function(){
				
				let url = window.location.href;
				let phone = url.substring(url.indexOf("=")+1,url.indexOf('&'));
				let agnum = url.substring(url.lastIndexOf('=')+1);
				// console.log(agnum+phone);
				
				$.ajax({
					url:"http://123.56.67.48:8080/docGetAgDetails",
					method:"POST",
					contentType:'application/json',
					data:JSON.stringify({
						phone:phone,
						agNum:agnum
					}),
					success:function(res){
						console.log(res);
						var k = JSON.parse(res);
						$("#JG").text(k.hospitalName);
						$("#JG_address").text(k.teamAddr);
						$("#sign_team").text(k.teamName);
						$("#Doc_name").text(k.docName);
						$("#Doc_id").text(k.docIdNum);
						$("#contract_number").text(agnum);
						$("#phone").text(phone);
						$("#patName").text(k.patName);
						$("#pakName").text(k.pakName);
						$("#patIdNum").text(k.patIdNum);
						$("#serPeople").text(k.serPeople);
						$("#duration").text(k.duration);
						$("#startTime").text(k.startTime);
						$("#hospital").text(k.hospitalName);
						$("#patAddr").text(k.patAddr);
					},
					error:function(){
						
					}
				});
			}
		</script>
	</body>
</html>
